package model

import (
	"gorm.io/datatypes"
	"zsc-boot/app/system_layer/model"
	"zsc-boot/core/orm"
)

type CustomerImportLog struct {
	orm.Model
	ChannelId    uint                    `json:"channelId" gorm:"column:channel_id"`
	ChannelInfo  CustomerChannel         `json:"channelInfo" gorm:"foreignKey:ChannelId"`
	ChannelName  string                  `json:"channel_name" gorm:"column:channel_name;comment:渠道名"`
	CustomerId   uint                    `json:"customerId" gorm:"column:customer_id;comment:客户id"`
	City         string                  `json:"city" gorm:"column:city;size:32"`
	Name         string                  `json:"name" gorm:"column:name;size:128"`
	Mobile       string                  `json:"mobile" gorm:"column:mobile;index:inx_mobile;size:32"`
	UserId       uint                    `json:"userId" gorm:"column:user_id;comment:分配后的员工id"`
	UserInfo     model.ServiceUserSimple `json:"userInfo" gorm:"foreignKey:UserId"`
	Money        string                  `json:"money" gorm:"column:money;size:32"`
	Remark       string                  `json:"remark" gorm:"type:text;column:remark;" `
	Sex          string                  `json:"sex" gorm:"column:sex;default:'';size:8"`
	Age          uint8                   `json:"age" gorm:"column:age"`
	IsRepeated   bool                    `json:"isRepeated" gorm:"default:false;column:is_repeated;comment:是否为重复申请"`
	IsAllocation bool                    `gorm:"column:is_allocation;comment:是否已处理;default:false" json:"isAllocation"`
	Tag          datatypes.JSON          `json:"tag" gorm:"column:tag;comment:标签"`
}

func (CustomerImportLog) TableName() string {
	return "customer_import_log"
}

func (CustomerImportLog) TableComment() string {
	return "客户流入记录表"
}
